import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_book/data/temp_data.dart';
import 'package:flutter_book/page/book/animation_util/data/animation_type.dart';
import '../../book/animation_util/book_animation_page.dart';
import 'dart:ui' as ui;
import 'package:flutter_book/util/extensions/string_extensions.dart';

class BookReadPageSlide extends StatefulWidget {
  BookReadPageSlide();
  @override
  _BookReadPageSlideState createState() => _BookReadPageSlideState();
}

class _BookReadPageSlideState extends State<BookReadPageSlide> with SingleTickerProviderStateMixin  {

  List<ui.Picture> listPicture=[];

  GlobalKey canvasKey=GlobalKey();

  late BookAnimationPageController _controller;

  @override
  void initState() {
    super.initState();
    _controller=BookAnimationPageController(this,canvasKey);
    _controller.setAnimationType(AnimationType.TYPE_ANIMATION_SLIDE_TURN);
    initData();
    initController();
  }

  initController(){
    // _controller.onTapListener((){
    //   "点击了界面".print;
    // });
    // _controller.onLongTapListener((){
    //   "长按了界面".print;
    // });
  }


  initData()async{
    listPicture.addAll(await TempData.getPictureList());
    // _controller.setPictureList(listPicture, false);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: null,
      // body:BookAnimationPage(controller:_controller),
      body: Container(),
    );
  }

}



